#!/bin/bash

# 启动 Interbench 的 Gaming 基准测试（在前台运行）
sudo ./interbench -W "Gaming" -t 60 

# 获取 Gaming 任务的 PID，并标记为时延敏感
gaming_pid=$(pgrep -f "interbench.*Gaming")

# 如果 Gaming 进程存在
if [ -n "$gaming_pid" ]; then
  # 将 Gaming 进程标记为时延敏感
  echo "$gaming_pid 1" | sudo tee /proc/latency_sensitive >/dev/null
  echo "Marked Gaming PID $gaming_pid as latency-sensitive"
else
  echo "Gaming process not found!"
fi

